<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// [ 应用入口文件 ]

// 定义应用目录
define('APP_PATH', __DIR__ . '/../application/');

$server_ip = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '0.0.0.0';

switch ($server_ip) {
    case "127.0.0.1" :        
        define('APP_DEBUG', false);     //开启调试模式
        define("APP_STATUS", "local"); //定义为本地环境
        break;
    case "192.168.1.94" :
        define('APP_DEBUG', true);     //开启调试模式
        define("APP_STATUS", "test");  //定义为内网测试环境
        break;
    case "10.169.142.165" :
    case "120.24.90.34" :
        define('APP_DEBUG', true);     //开启调试模式
        define("APP_STATUS", "pre");   //定义为外网测试环境
        break;
    default :
        define('APP_DEBUG', false);      //关闭调试模式
        define("APP_STATUS", "product"); //定义为生产环境
        break;
}

// 加载框架引导文件
require __DIR__ . '/../thinkphp/start.php';
